Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add spam classifier with google gemini flash 2.0 experimental and check for spam earlier #58

Merged
merged 6 commits into from
Jan 9, 2025

Conversation

nonprofittechy
Copy link
Member

Fix #54

This adds a basically free and optional spam filter to the feedback form, driven by Google Gemini.

If the user's message passes the keyword filter, it will be sent to Google Gemini flash 2.0 experimental for additional filtering. As of 1/3/2025, the free tier has a limit of 1,500 queries/day, plenty to handle the small volume of feedback form spam we've been dealing with (a dozen a month in some cases).

To use it, a google gemini api key must be added to the global configuration.

I also noticed that the existing spam filtering wasn't being used except when the form fell back to delivering an email. I'm not sure why that was the case but this should also solve that problem.

@nonprofittechy nonprofittechy merged commit 2fefe6c into main Jan 9, 2025
4 checks passed
@nonprofittechy nonprofittechy deleted the check-spam-with-gemini branch January 9, 2025 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a better spam filter with Bayesian classification
2 participants